.class abstract Les/ge0;
.super Ljava/lang/Object;
.source "OBEXClientOperation.java"

# interfaces
.implements Les/up0;
.implements Les/me0;
.implements Les/qe0;
.implements Les/ne0;


# instance fields
.field protected a:Les/je0;

.field protected b:C

.field protected c:Les/tp0;

.field protected d:Z

.field protected e:Z

.field protected f:Les/pe0;

.field protected g:Z

.field protected h:Les/oe0;

.field protected i:Z

.field protected j:Z

.field protected k:Z

.field protected l:Les/le0;

.field private m:Z

.field protected n:Ljava/lang/Object;


# direct methods
.method constructor <init>(Les/je0;CLes/le0;)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Les/ge0;->g:Z

    .line 3
    iput-boolean v0, p0, Les/ge0;->i:Z

    .line 4
    iput-boolean v0, p0, Les/ge0;->j:Z

    .line 5
    iput-boolean v0, p0, Les/ge0;->k:Z

    const/4 v1, 0x0

    .line 6
    iput-object v1, p0, Les/ge0;->l:Les/le0;

    .line 7
    iput-boolean v0, p0, Les/ge0;->m:Z

    .line 8
    iput-object p1, p0, Les/ge0;->a:Les/je0;

    .line 9
    iput-char p2, p0, Les/ge0;->b:C

    .line 10
    iput-boolean v0, p0, Les/ge0;->d:Z

    .line 11
    new-instance p1, Ljava/lang/Object;

    invoke-direct {p1}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Les/ge0;->n:Ljava/lang/Object;

    .line 12
    new-instance p1, Les/oe0;

    invoke-direct {p1, p0}, Les/oe0;-><init>(Les/me0;)V

    iput-object p1, p0, Les/ge0;->h:Les/oe0;

    .line 13
    invoke-virtual {p0, p3}, Les/ge0;->a(Les/le0;)V

    return-void
.end method

.method private b(Les/le0;)V
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x1

    .line 1
    :try_start_0
    iget-object v1, p0, Les/ge0;->a:Les/je0;

    iget-char v2, p0, Les/ge0;->b:C

    invoke-virtual {v1, v2, p1}, Les/ve0;->a(ILes/le0;)V

    .line 2
    iget-object v1, p0, Les/ge0;->a:Les/je0;

    invoke-virtual {v1}, Les/ve0;->j()[B

    move-result-object v1

    const/4 v2, 0x0

    .line 3
    aget-byte v3, v1, v2

    const/4 v4, 0x3

    invoke-static {v3, v1, v4}, Les/le0;->a(B[BI)Les/le0;

    move-result-object v1

    .line 4
    iget-object v3, p0, Les/ge0;->a:Les/je0;

    const/4 v4, 0x0

    invoke-virtual {v3, v1, v4}, Les/ve0;->a(Les/le0;Les/wp0;)Z

    .line 5
    invoke-virtual {v1}, Les/le0;->b()I

    move-result v3

    const-string v4, "client operation got reply"

    .line 6
    invoke-static {v3}, Les/xe0;->c(I)Ljava/lang/String;

    move-result-object v5

    int-to-long v6, v3

    invoke-static {v4, v5, v6, v7}, Les/be0;->a(Ljava/lang/String;Ljava/lang/String;J)V

    const/16 v4, 0x90

    if-eq v3, v4, :cond_3

    const/16 v4, 0xa0

    if-eq v3, v4, :cond_2

    const/16 v4, 0xc1

    if-eq v3, v4, :cond_0

    .line 7
    iput-boolean v0, p0, Les/ge0;->j:Z

    .line 8
    iput-boolean v2, p0, Les/ge0;->e:Z

    .line 9
    invoke-virtual {p0, v1}, Les/ge0;->g(Les/tp0;)V

    .line 10
    invoke-virtual {p0, v1, v0}, Les/ge0;->a(Les/tp0;Z)V

    goto :goto_0

    .line 11
    :cond_0
    iget-boolean v3, p0, Les/ge0;->m:Z

    if-nez v3, :cond_1

    invoke-virtual {v1}, Les/le0;->e()Z

    move-result v3

    if-eqz v3, :cond_1

    const-string v2, "client resend request with auth response"

    .line 12
    invoke-static {v2}, Les/be0;->a(Ljava/lang/String;)V

    .line 13
    invoke-static {p1}, Les/le0;->a(Les/tp0;)Les/le0;

    move-result-object p1

    .line 14
    iget-object v2, p0, Les/ge0;->a:Les/je0;

    invoke-virtual {v2, v1, p1}, Les/ve0;->a(Les/le0;Les/le0;)V

    .line 15
    iput-boolean v0, p0, Les/ge0;->m:Z

    .line 16
    invoke-direct {p0, p1}, Les/ge0;->b(Les/le0;)V

    goto :goto_0

    .line 17
    :cond_1
    iput-boolean v0, p0, Les/ge0;->j:Z

    .line 18
    iput-boolean v2, p0, Les/ge0;->e:Z

    .line 19
    invoke-virtual {p0, v1}, Les/ge0;->g(Les/tp0;)V

    .line 20
    new-instance p1, Ljava/io/IOException;

    const-string v1, "Authentication Failure"

    invoke-direct {p1, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 21
    :cond_2
    invoke-virtual {p0, v1}, Les/ge0;->g(Les/tp0;)V

    .line 22
    invoke-virtual {p0, v1, v0}, Les/ge0;->a(Les/tp0;Z)V

    .line 23
    iput-boolean v2, p0, Les/ge0;->e:Z

    goto :goto_0

    .line 24
    :cond_3
    invoke-virtual {p0, v1}, Les/ge0;->g(Les/tp0;)V

    .line 25
    invoke-virtual {p0, v1, v2}, Les/ge0;->a(Les/tp0;Z)V

    .line 26
    iput-boolean v0, p0, Les/ge0;->e:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :goto_0
    return-void

    :catchall_0
    move-exception p1

    .line 27
    iput-boolean v0, p0, Les/ge0;->j:Z

    .line 28
    throw p1
.end method

.method private k()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/ge0;->f:Les/pe0;

    if-eqz v0, :cond_1

    .line 2
    iget-object v0, p0, Les/ge0;->n:Ljava/lang/Object;

    monitor-enter v0

    .line 3
    :try_start_0
    iget-object v1, p0, Les/ge0;->f:Les/pe0;

    if-eqz v1, :cond_0

    .line 4
    iget-object v1, p0, Les/ge0;->f:Les/pe0;

    invoke-virtual {v1}, Les/pe0;->close()V

    :cond_0
    const/4 v1, 0x0

    .line 5
    iput-object v1, p0, Les/ge0;->f:Les/pe0;

    .line 6
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    :cond_1
    :goto_0
    return-void
.end method

.method private l()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    :try_start_0
    invoke-direct {p0}, Les/ge0;->m()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 2
    iget-object v0, p0, Les/ge0;->h:Les/oe0;

    invoke-virtual {v0}, Les/oe0;->close()V

    .line 3
    invoke-direct {p0}, Les/ge0;->k()V

    return-void

    :catchall_0
    move-exception v0

    .line 4
    iget-object v1, p0, Les/ge0;->h:Les/oe0;

    invoke-virtual {v1}, Les/oe0;->close()V

    .line 5
    invoke-direct {p0}, Les/ge0;->k()V

    .line 6
    throw v0
.end method

.method private m()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    :goto_0
    invoke-virtual {p0}, Les/ge0;->isClosed()Z

    move-result v0

    if-nez v0, :cond_0

    iget-boolean v0, p0, Les/ge0;->e:Z

    if-eqz v0, :cond_0

    const-string v0, "operation expects operation end"

    .line 2
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    .line 3
    iget-object v0, p0, Les/ge0;->h:Les/oe0;

    invoke-virtual {p0, v0}, Les/ge0;->a(Les/oe0;)V

    goto :goto_0

    :cond_0
    return-void
.end method


# virtual methods
.method protected a(Les/le0;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iput-object p1, p0, Les/ge0;->l:Les/le0;

    return-void
.end method

.method public a(Les/oe0;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 2
    iget-object p1, p0, Les/ge0;->l:Les/le0;

    invoke-direct {p0, p1}, Les/ge0;->b(Les/le0;)V

    const/4 p1, 0x0

    .line 3
    iput-object p1, p0, Les/ge0;->l:Les/le0;

    return-void
.end method

.method protected a(Les/tp0;Z)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/16 v0, 0x48

    .line 14
    invoke-interface {p1, v0}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [B

    if-nez v0, :cond_0

    const/16 v0, 0x49

    .line 15
    invoke-interface {p1, v0}, Les/tp0;->a(I)Ljava/lang/Object;

    move-result-object p1

    move-object v0, p1

    check-cast v0, [B

    if-eqz v0, :cond_0

    const/4 p2, 0x1

    :cond_0
    if-eqz v0, :cond_1

    .line 16
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "client received Data eof: "

    invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    const-string v1, " len: "

    invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    array-length v1, v0

    int-to-long v1, v1

    invoke-static {p1, v1, v2}, Les/be0;->a(Ljava/lang/String;J)V

    .line 17
    iget-object p1, p0, Les/ge0;->h:Les/oe0;

    invoke-virtual {p1, v0, p2}, Les/oe0;->a([BZ)V

    goto :goto_0

    :cond_1
    if-eqz p2, :cond_2

    .line 18
    iget-object p1, p0, Les/ge0;->h:Les/oe0;

    const/4 v0, 0x0

    invoke-virtual {p1, v0, p2}, Les/oe0;->a([BZ)V

    :cond_2
    :goto_0
    return-void
.end method

.method public a(Z[B)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 4
    iget-boolean v0, p0, Les/ge0;->k:Z

    if-eqz v0, :cond_0

    return-void

    .line 5
    :cond_0
    iget-object v0, p0, Les/ge0;->l:Les/le0;

    if-eqz v0, :cond_1

    .line 6
    invoke-direct {p0, v0}, Les/ge0;->b(Les/le0;)V

    const/4 v0, 0x0

    .line 7
    iput-object v0, p0, Les/ge0;->l:Les/le0;

    :cond_1
    const/16 v0, 0x48

    if-eqz p1, :cond_2

    .line 8
    iget-char p1, p0, Les/ge0;->b:C

    or-int/lit16 p1, p1, 0x80

    int-to-char p1, p1

    iput-char p1, p0, Les/ge0;->b:C

    const/16 v0, 0x49

    const-string p1, "client Request Phase ended"

    .line 9
    invoke-static {p1}, Les/be0;->a(Ljava/lang/String;)V

    const/4 p1, 0x1

    .line 10
    iput-boolean p1, p0, Les/ge0;->k:Z

    .line 11
    :cond_2
    invoke-static {}, Les/ve0;->l()Les/le0;

    move-result-object p1

    .line 12
    invoke-virtual {p1, v0, p2}, Les/le0;->a(ILjava/lang/Object;)V

    .line 13
    invoke-direct {p0, p1}, Les/ge0;->b(Les/le0;)V

    return-void
.end method

.method public b()I
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 29
    invoke-virtual {p0}, Les/ge0;->j()V

    .line 30
    invoke-virtual {p0}, Les/ge0;->i()V

    .line 31
    invoke-direct {p0}, Les/ge0;->k()V

    .line 32
    invoke-direct {p0}, Les/ge0;->m()V

    .line 33
    iget-object v0, p0, Les/ge0;->c:Les/tp0;

    invoke-interface {v0}, Les/tp0;->b()I

    move-result v0

    return v0
.end method

.method public b(Les/tp0;)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    if-eqz p1, :cond_2

    .line 34
    invoke-static {p1}, Les/le0;->c(Les/tp0;)V

    .line 35
    invoke-virtual {p0}, Les/ge0;->j()V

    .line 36
    iget-boolean v0, p0, Les/ge0;->k:Z

    if-nez v0, :cond_1

    .line 37
    iget-object v0, p0, Les/ge0;->l:Les/le0;

    if-eqz v0, :cond_0

    .line 38
    invoke-direct {p0, v0}, Les/ge0;->b(Les/le0;)V

    const/4 v0, 0x0

    .line 39
    iput-object v0, p0, Les/ge0;->l:Les/le0;

    .line 40
    :cond_0
    check-cast p1, Les/le0;

    invoke-direct {p0, p1}, Les/ge0;->b(Les/le0;)V

    return-void

    .line 41
    :cond_1
    new-instance p1, Ljava/io/IOException;

    const-string v0, "the request phase has already ended"

    invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 42
    :cond_2
    new-instance p1, Ljava/lang/NullPointerException;

    const-string v0, "headers are null"

    invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public close()V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-string v0, "client operation closed"

    const/4 v1, 0x1

    .line 1
    :try_start_0
    invoke-virtual {p0}, Les/ge0;->i()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 2
    invoke-direct {p0}, Les/ge0;->l()V

    .line 3
    iget-boolean v2, p0, Les/ge0;->d:Z

    if-nez v2, :cond_0

    .line 4
    iput-boolean v1, p0, Les/ge0;->d:Z

    .line 5
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    :cond_0
    return-void

    :catchall_0
    move-exception v2

    .line 6
    invoke-direct {p0}, Les/ge0;->l()V

    .line 7
    iget-boolean v3, p0, Les/ge0;->d:Z

    if-nez v3, :cond_1

    .line 8
    iput-boolean v1, p0, Les/ge0;->d:Z

    .line 9
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    .line 10
    :cond_1
    throw v2
.end method

.method public e()Ljava/io/DataInputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    new-instance v0, Ljava/io/DataInputStream;

    invoke-interface {p0}, Les/np0;->a()Ljava/io/InputStream;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V

    return-object v0
.end method

.method public f()Les/tp0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-virtual {p0}, Les/ge0;->j()V

    .line 2
    invoke-virtual {p0}, Les/ge0;->i()V

    .line 3
    iget-object v0, p0, Les/ge0;->c:Les/tp0;

    invoke-static {v0}, Les/le0;->a(Les/tp0;)Les/le0;

    move-result-object v0

    return-object v0
.end method

.method public g()Ljava/io/DataOutputStream;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 4
    new-instance v0, Ljava/io/DataOutputStream;

    invoke-interface {p0}, Les/op0;->h()Ljava/io/OutputStream;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V

    return-object v0
.end method

.method protected g(Les/tp0;)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/ge0;->c:Les/tp0;

    if-eqz v0, :cond_0

    .line 2
    invoke-static {p1, v0}, Les/le0;->a(Les/tp0;Les/tp0;)Les/tp0;

    .line 3
    :cond_0
    iput-object p1, p0, Les/ge0;->c:Les/tp0;

    return-void
.end method

.method protected i()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Les/ge0;->k:Z

    if-eqz v0, :cond_0

    return-void

    :cond_0
    const-string v0, "client ends Request Phase"

    .line 2
    invoke-static {v0}, Les/be0;->a(Ljava/lang/String;)V

    const/4 v0, 0x1

    .line 3
    iput-boolean v0, p0, Les/ge0;->k:Z

    .line 4
    iget-char v0, p0, Les/ge0;->b:C

    or-int/lit16 v0, v0, 0x80

    int-to-char v0, v0

    iput-char v0, p0, Les/ge0;->b:C

    .line 5
    iget-object v0, p0, Les/ge0;->l:Les/le0;

    invoke-direct {p0, v0}, Les/ge0;->b(Les/le0;)V

    const/4 v0, 0x0

    .line 6
    iput-object v0, p0, Les/ge0;->l:Les/le0;

    return-void
.end method

.method public isClosed()Z
    .locals 1

    .line 1
    iget-boolean v0, p0, Les/ge0;->d:Z

    if-nez v0, :cond_1

    iget-boolean v0, p0, Les/ge0;->j:Z

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    goto :goto_1

    :cond_1
    :goto_0
    const/4 v0, 0x1

    :goto_1
    return v0
.end method

.method protected j()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Les/ge0;->d:Z

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    new-instance v0, Ljava/io/IOException;

    const-string v1, "operation closed"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method
